import gtk
import gtk.glade

from about import About
from preferences import Preferences

class UI:
    
    def __init__(self):
        self.gladefile = "schrenckiiui.glade"
        self.wtree = gtk.glade.XML(self.gladefile)

        self.window = self.get_widget("schrenckii")
        self.draw_area_game = self.get_widget("draw_area_game")

        self.about = About(self.get_widget("about"))

        widgetnames = ["starting_level", "random_colours", "shadow",
            "theme", "control"]
        
        widgets = {}
        for widget in widgetnames:
            widgets[widget] = self.get_widget(widget)
        
        self.preferences = Preferences(self.get_widget("preferences"), widgets)


    def get_widget(self, widget):
        return self.wtree.get_widget(widget)


